package com.itheima.test;

import java.util.Scanner;



        public class Demo1 {
            public static void main(String[] args) {
                //  1.键盘录入,使用Scanner实现
                //  2.判断是否是水仙花数


                Scanner sc = new Scanner(System.in);
                System.out.println("请输入一个三位整数");
                int i =sc.nextInt();
                int g = i  % 10 ;
                int s = i / 10 % 10;
                int b = i / 100;

                if(i>=100&&i<=999) {
                    if (g * g * g + s * s * s + b * b * b == i) {
                        System.out.println("是水仙花数");
                    } else {
                        System.out.println("不是水仙花数");
                    }
                }else {
                    System.out.println("输入有误");
                }

            }
        }

